package com.itheima.tliasmanagement.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.tliasmanagement.dto.PageDTO;
import com.itheima.tliasmanagement.entity.OperateLog;
import com.itheima.tliasmanagement.mapper.OperateLogMapper;
import com.itheima.tliasmanagement.service.OperateLogService;
import com.itheima.tliasmanagement.vo.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OperateLogServiceImpl implements OperateLogService {
    @Autowired
    private OperateLogMapper logMapper;

    @Override
    public PageBean<OperateLog> pageQuery(PageDTO dto) {
        PageHelper.startPage(dto.getPage(), dto.getPageSize());
        Page<OperateLog> page = logMapper.pageQuery();
        return new PageBean<>(page.getTotal(), page.getResult());
    }
}
